<?php
/**
 * Created by PhpStorm.
 * User: huihui
 * Date: 2019/8/28
 * Time: 8:13 PM
 */

namespace app\index\controller;


use app\common\controller\Frontend;
use think\Request;
use app\common\model\Doc;

class Docs extends Frontend
{
    protected $layout = 'default';
    private $model;
    protected $noNeedLogin = ['*'];

    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $this->model = new Doc();
    }

    public function help()
    {
        $doc = Doc::get('1');
        $this->assign('doc',$doc);
        $this->assign('title',$doc->title);
        return $this->fetch('doc');
    }

    public function developer()
    {
        $user = $this->auth->getUser();
        if ($user['vip_expire_time'] == null || time()>strtotime($user['vip_expire_time'])){
            $this->error("服务到期，无法查看");
        }
        $doc = Doc::get('2');
        $this->assign('doc',$doc);
        $this->assign('title',$doc->title);
        return $this->fetch('doc');
    }
}